package com.chenyuxin.ilp.service.user.Impl;

import cn.hutool.core.bean.BeanUtil;
import com.chenyuxin.ilp.mapper.user.UserStatisticsMapper;
import com.chenyuxin.ilp.model.entity.user.UserStatistics;
import com.chenyuxin.ilp.model.pojo.Result;
import com.chenyuxin.ilp.model.vo.user.UserStatisticVo;
import com.chenyuxin.ilp.service.user.UserStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserStatisticsServiceImpl implements UserStatisticsService {
    @Autowired
    private UserStatisticsMapper userStatisticsMapper;
    @Override
    public Result getUserStatistic(String userId) {
        UserStatistics userStatistics = userStatisticsMapper.selectById(userId);
        UserStatisticVo userStatisticVo = BeanUtil.copyProperties(userStatistics, UserStatisticVo.class);
        return Result.ok(userStatisticVo);
    }
}
